//
//  ViewController.m
//  UI16_UICollectionView封装轮播图
//
//  Created by tusm on 16/8/4.
//  Copyright © 2016年 tusm. All rights reserved.
//

#import "ViewController.h"
#import "JHCollectionViewCycleImage.h"

@interface ViewController ()<JHCollectionViewDataSourceDelegate,JHCollectionViewCycleImageDelegate>
@property (weak, nonatomic) IBOutlet JHCollectionViewCycleImage *cycleImage;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    
    
//    JHCollectionViewCycleImage *cycle = [[JHCollectionViewCycleImage alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 200)];
//    [self.view addSubview:cycle];
    
    NSMutableArray *array = [NSMutableArray array];
    
    for (int i = 0; i < 5; i ++) {
        [array addObject:[NSString stringWithFormat:@"%d.jpg",i]];
    }
    //插入头尾图片
    NSString *firstImage = [array firstObject];
    NSString *lastImage = [array lastObject];
    [array insertObject:lastImage atIndex:0];
    [array addObject:firstImage];
    
    _cycleImage.array = array;
    _cycleImage.labelArray = @[@"0",@"1", @"2", @"3", @"4", @"5", @"1"];
    _cycleImage.dataSource = self;
    
}
- (void)handleDataSourceObject:(id)object cell:(UICollectionViewCell *)cell{

    

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
